
mod sparse_set;

#[macro_use]
mod component;
pub use component::*;
mod storage;
mod archetype;
mod entity;
pub use entity::*;
mod world;
pub use world::*;

#[derive(PartialEq,Debug,Hash,Eq,Clone, Copy)]
pub enum MangoEcsError {
    NoMatchingComponent(&'static str),
    EntityMissing,
    ChannelExclusivelyLocked
}

impl MangoEcsError {
    fn no_matching_component<T:ComponentTrait>() -> Self{
        Self::NoMatchingComponent(std::any::type_name::<T>())
    }
}



macro_rules! tuple_impls {
    // ( $count: tt, $( ($index: tt, $tuple:ident) ),*) => {
    ( $count: tt, $( ($index: tt, $tuple:ident) ),*) => {
        component_bundle_tuple_impls! { $count, $( ($index, $tuple) ),* }
        
    };
}



tuple_impls! {0,}
tuple_impls! { 1, (0, A) }
tuple_impls! { 2, (0, A), (1, B) }
tuple_impls! { 3, (0, A), (1, B), (2, C) }
tuple_impls! { 4, (0, A), (1, B), (2, C), (3, D)}
tuple_impls! { 5, (0, A), (1, B), (2, C), (3, D), (4, E)}
tuple_impls! { 6, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F)}
tuple_impls! { 7, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G)}
tuple_impls! { 8, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H)}
tuple_impls! { 9, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I)}
tuple_impls! { 10, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I), (9, J)}
tuple_impls! { 11, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I), (9, J), (10, K)}
tuple_impls! { 12, (0, A), (1, B), (2, C), (3, D), (4, E), (5, F), (6, G), (7, H), (8, I), (9, J), (10, K), (11, L)}
